<?php

/**
 * user actions.
 *
 * @package    Timetabler‏
 * @subpackage user
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class userActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');
  }



  public function executeFirstPage($request)
  {

     $this->form = new sfForm();
     $this->form->setWidgets(array(
     'name' => new sfWidgetFormInput(array('label' => 'Username')),
     'password' => new sfWidgetFormInputPassword(array('label' => 'Passwordd')),));

     $name = $request->getParameter('name');
     // Store data in the user session
     $this->getUser()->setAttribute('name', $name);

     if($name=='Abrar')
     $this->redirect('user/secondPage');

  }



  public function executeSecondPage()
  {
   //Retrieve data from the user session with a default value
   $this->name = $this->getUser()->getAttribute('name');
  }


 public function executeInfo($request)
  {
     $this->form = new InfoForm();
 
    if ($request->isMethod('post'))
    {
      $this->form->bind($request->getParameter('contact'));
      if ($this->form->isValid())
      {
        //$this->redirect('contact/index?'.http_build_query($this->form->getValues()));
           
          echo  $this->form->getValue('email');
          echo  $this->form->getValue('gender');
          echo  $this->form->getValue('special role');

      }
    }
  }//end info function 










}
